/**
 * Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.servicecenter.domain;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jeeplus.core.domain.BaseEntity;
import com.jeeplus.sys.service.dto.UserDTO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;
import java.util.List;

/**
 * 批阅会员申请Entity
 * @author 淋漓
 * @version 2024-05-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("uip_association_apply")
public class AssociationApply extends BaseEntity {

	private static final long serialVersionUID = 1L;

			
	/**
     * 登录名
     */
	private String loginName;
			
	/**
     * 学校id
     */
	private String companyId;
			
	/**
     * 工会id
     */
	private String officeId;
			
	/**
     * 职位id
     */
	private String roleId;
			
	/**
     * 岗位id
     */
	private String postId;
			
	/**
     * 备注
     */
	private String remarks;
			
	/**
     * 申请时间
     */
	private Date applyTime;
			
	/**
     * 处理时间
     */
	private Date dealTime;
			
	/**
     * 处理结果
     */
	private String result;
			
	/**
     * 用户姓名
     */
	private String name;

	public AssociationApply(){}
	public AssociationApply(UserDTO userDTO){
		setId(userDTO.getId());
		setLoginName(userDTO.getLoginName());
		setCompanyId(userDTO.getCompanyDTO().getId());
		setOfficeId(userDTO.getOfficeDTO().getId());
		setPostId(userDTO.getPostIdList().get(0));
		setRoleId(userDTO.getRoleIdList().get(0));
		setRemarks(userDTO.getRemarks());
		setApplyTime(new Date());
		setDealTime(new Date());
		setResult("已同意");
		setName(userDTO.getName());
		setDelFlag(userDTO.hashCode());
	}
}
